using System.Collections;
using System.Collections.Generic;
using UnityEngine;

//自动生成于：2020/11/18 14:30:43
namespace StarForce
{

	public partial class RedDotPage : UGuiForm
	{

		protected override void OnInit(object userdata)
		{
			base.OnInit(userdata);

			GetBindComponents(gameObject);
			m_Btn_Close.onClick.AddListener(Close);
			
			//红点数据
			List<int> ids = new List<int>()
			{
				1,2
			};
			
			GameEntry.RedDot.InitRedId(ids);
			
			
			GameEntry.RedDot.RegisterRedDot(RedDotComponent.RedDotType.Mail,m_Img_MailRed.gameObject);
			GameEntry.RedDot.RegisterRedDot(RedDotComponent.RedDotType.Friend,m_Img_FriendRed.gameObject);
			GameEntry.RedDot.RegisterRedDot(RedDotComponent.RedDotType.Fight,m_Img_FightRed.gameObject);
			
			m_Btn_AddAll.onClick.AddListener(OnAddAll);
			
			m_Btn_RemoveAll.onClick.AddListener(OnRemoveAll);
			
			m_Btn_AddMailRed.onClick.AddListener(OnAddMail);
		}

		private void OnAddMail()
		{
			GameEntry.RedDot.AddRedId(0);
		}

		private void OnRemoveAll()
		{
			GameEntry.RedDot.RemoveRedId(0);
			GameEntry.RedDot.RemoveRedId(1);
			GameEntry.RedDot.RemoveRedId(2);
		}

		private void OnAddAll()
		{
			GameEntry.RedDot.AddRedId(0);
			GameEntry.RedDot.AddRedId(1);
			GameEntry.RedDot.AddRedId(2);
		}

		protected override void OnOpen(object userData)
		{
			base.OnOpen(userData);
		}
	}
}
